﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;

namespace AuthExtensions.Auth
{
    public interface IAuthToken
    {
        /// <summary>
        /// 构建token
        /// </summary>
        /// <param name="claims"></param>
        /// <returns></returns>
        TokenDto Build(Claim[] claims);
        /// <summary>
        /// 构建cookie认证
        /// </summary>
        /// <param name="claims"></param>
        /// <returns></returns>
        Task BuildIdentity(Claim[] claims);
    }

    public class TokenDto
    {
        /// <summary>
        /// token
        /// </summary>
        public string Token { get; set; }

        /// <summary>
        /// 当前时间
        /// </summary>
        public DateTime Now { get; set; }

        /// <summary>
        /// 过期时间
        /// </summary>
        public DateTime ExpiresIn { get; set; }
    }
}
